//
//  FoundViewController.m
//  LoginAndRegister
//
//  Created by 苗钧豪 on 16/7/15.
//  Copyright © 2016年 苗钧豪. All rights reserved.
//

#import "FoundViewController.h"
#import "myView.h"
// 引入对应头文件
#import <QuartzCore/QuartzCore.h>
@interface FoundViewController ()<UITextFieldDelegate>

@end

@implementation FoundViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor greenColor];
    self.navigationController.navigationBarHidden = YES;

    // 创建自定义view
    myView *myview = [[myView alloc]initWithFrame:CGRectMake(100, 300, 150, 30) placeholder:@"绑定邮箱" borderStyle:(UITextBorderStyleRoundedRect) secureTextEbtry:NO keyboardType:(UIKeyboardTypeDefault)];
    myview.textfield.delegate = self;
    // 设置自定义view的圆角
    myview.layer.cornerRadius = 5;
    myview.layer.masksToBounds = YES;
    [self.view addSubview:myview];
    // 创建按钮
    UIButton *button = [UIButton buttonWithType:(UIButtonTypeSystem)];
    button.frame = CGRectMake(150, 400, 55, 40);
    button.backgroundColor = [UIColor orangeColor];
    [button setTitle:@"完成" forState:(UIControlStateNormal)];
    [button addTarget:self action:@selector(finish) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:button];
}
// 按钮执行的方法，模态返回上一个界面
- (void)finish {
    [self dismissViewControllerAnimated:YES completion:nil];
}
// 回收键盘
- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
    [textField resignFirstResponder];
    return YES;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
